<template>
	<view>
		<view class="text" space="nbsp">
			<block v-for="textitem in textChuli(text)">
				<text space="nbsp" v-if="textitem.type == 'text'">{{textitem.text}}</text>
				<text space="nbsp" v-if="textitem.type == 'url'" style="color:#4D6B8B;" @click="goToUrl(textitem.text)">{{textitem.text}}</text>
			</block>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			text: ''
		};
	},
	onLoad(e) {
		this.text = e.text;
	},
	methods: {
		textChuli(content) {
			content = content.replace(/\r|\n/ig,"");
			return this.$fc.textGetUrl({content:content});
		},
		goToUrl(url){
			return this.$fc.goWebUrl({url:url});
		},
	}
};
</script>
<style>
	.text{
		font-size: 32rpx;
		word-break: break-all;
		display: block;
		padding: 30rpx;
	}
</style>
